if (argument0!="all")
{
var i,tmp;
tmp=ds_grid_create(3,0);
for(i=0;i<ds_grid_height(global.invs);i++)
{
if (ds_grid_get(global.invs,0,i)!=argument0)
{
ds_grid_resize(tmp,3,ds_grid_height(tmp)+1);
ds_grid_set(tmp,0,ds_grid_height(tmp)-1,ds_grid_get(global.invs,0,i));
ds_grid_set(tmp,1,ds_grid_height(tmp)-1,ds_grid_get(global.invs,1,i));
ds_grid_set(tmp,2,ds_grid_height(tmp)-1,ds_grid_get(global.invs,2,i));
}
}
global.invs=tmp;

with(inv_obj) instance_destroy();


for (i=0;i<ds_grid_height(global.invs);i++)
{
o=instance_create(0,0,inv_obj);
o.origin=i;
o.orig_x=o.w/2+10;
o.orig_y=(i+0.5)*(o.h+10)+5;
    
o.lgn=ds_grid_get(global.invs,0,i);
o.fight.lgn=o.lgn;
o.chicken.lgn=o.lgn;
o.points=ds_grid_get(global.invs,1,i); 
o.time=ds_grid_get(global.invs,2,i);
if o.points>global.points 
{
o.mybet=5;
dif=o.points-global.points;
if dif<=20 o.enemybet=5 else 
if dif<=40 o.enemybet=6 else 
if dif<=60 o.enemybet=7 else 
if dif<=80 o.enemybet=8 else 
if dif<=100 o.enemybet=10 else 
if dif<=150 o.enemybet=15 else 
if dif<=200 o.enemybet=20 else 
if dif<=250 o.enemybet=25 else 
if dif<=300 o.enemybet=30 else 
if dif<=350 o.enemybet=40 else 
if dif<=400 o.enemybet=50
  
} else
{
o.enemybet=5;
dif=global.points-o.points;
if dif<=20 o.mybet=5 else 
if dif<=40 o.mybet=6 else 
if dif<=60 o.mybet=7 else 
if dif<=80 o.mybet=8 else 
if dif<=100 o.mybet=10 else 
if dif<=150 o.mybet=15 else 
if dif<=200 o.mybet=20 else 
if dif<=250 o.mybet=25 else 
if dif<=300 o.mybet=30 else 
if dif<=350 o.mybet=40 else 
if dif<=400 o.mybet=50

}

}} else
{global.invs=ds_grid_create(3,0);}
if instance_exists(inv_btn)
inv_btn.cnt=ds_grid_height(global.invs);
